import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ElementUI from 'element-ui';
import axios from 'axios';
import { Button,MessageBox ,Dialog,Form ,Container,Header,Aside,Main,Menu,Submenu,MenuItem,MenuItemGroup,Breadcrumb,BreadcrumbItem,Card,Row,Col,Pagination} from 'element-ui';
import { Message} from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import './assets/font/font_73i723amqdu/iconfont.css'
import './assets/css/gobal.css'
// 导入表格树
import TreeTable from 'vue-table-with-tree-grid'

// 组件全局注册 表格树
Vue.component('tree-table', TreeTable)
Vue.use(ElementUI);
// eslint-disable-next-line no-undef
Vue.use(Dialog);
Vue.use(Button);
Vue.use(Form);
Vue.use(Container);
Vue.use(Header);
Vue.use(Aside);
Vue.use(Main);
Vue.use(Menu);
Vue.use(MenuItem);
Vue.use(MenuItemGroup);
Vue.use(Submenu);
Vue.use(Breadcrumb);
Vue.use(BreadcrumbItem);
Vue.use(Card);
Vue.use(Row);
Vue.use(Col);
Vue.use(Pagination)

// //求挂载到vue全局，每个vue组件都可以通过this.$http发起请
Vue.prototype.$http=axios
Vue.prototype.$message=Message
Vue.prototype.$confirm=MessageBox.confirm
axios.defaults.baseURL='http://timemeetyou.com:8889/api/private/v1/'
//设置请求拦截器
axios.interceptors.request.use(config=>{
  console.log(config)
//给Authorization的请求头放入token，必须携带token才能访问api接口
  config.headers.Authorization=window.sessionStorage.getItem('token')
  return config;
})
Vue.config.productionTip = false

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
